<template>
  <div class="product-info-lay">
    <el-form>
      <el-form-item label="产品名称">
        <el-input />
      </el-form-item>
      <el-form-item label="产品标识">
        <el-input />
      </el-form-item>
      <el-form-item label="首页地址">
        <el-input />
      </el-form-item>
      <el-form-item label="验证地址">
        <el-input />
      </el-form-item>
      <el-form-item label="资源继承">
        <div class="inherit-item" v-for="(item, index) in assetList" :key="index">
          <el-checkbox :label="item.name" />
          <!-- <span>(</span>
          <span style="color: blue;">{{ item.product }}</span>
          <span>)</span> -->
        </div>
      </el-form-item>
      <el-form-item label="产品描述">
        <el-input type="textarea" v-model="productInfo.desc" :rows="3" />
      </el-form-item>
    </el-form>
    <div class="product-footer">
        <el-button type="danger">取消</el-button>
        <el-button type="primary" style="margin-left: 32px;">保存</el-button>
    </div>
  </div>
</template>

<script setup lang="ts">
import {ref} from "vue";

const productInfo = ref({
    desc: '123'
});

const assetList = ref([
  {
    name: '菜单',
    type: 'MENU',
    productCode: 'default',
  },
  {
    name: '角色',
    type: 'MENU',
    productCode: 'default',
  },
  {
    name: '权限',
    type: 'PERMIT',
    productCode: 'default',
  },
  {
    name: '客户',
    type: 'CLIENT',
    productCode: 'default',
  },
  {
    name: '地址',
    type: 'URL',
    productCode: 'default',
  },
  {
    name: '用户',
    type: 'USER',
    productCode: 'default',
  }
]);

</script>

<style scoped>
.product-info-lay {
    display: flex;
    flex-direction: column;
    margin: 16px 32px;
    justify-content: flex-start;
    width: 50%;
}

.inherit-item {
  display: flex;
  flex-direction: row; 
  margin: 0 8px;
  justify-items: center;
  align-items: center;
}

.product-footer {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    margin: 16px 0;
}
</style>
